<?php

namespace app\common\model\Product;

use think\Model;
// 引用软删除
use traits\model\SoftDelete;

class OrderProduct extends Model
{
    // 订单商品表
    protected $table = 'pre_order_product';

    // 软删除
    use SoftDelete;
    protected $deleteTime = 'deletetime';

    public function product()
    {
        return $this->belongsTo('app\common\model\Product\Product', 'proid', 'id', [], 'RIGHT')->setEagerlyType(0);
    }

    public function order()
    {
        return $this->belongsTo('app\common\model\Product\Order', 'orderid', 'id', [])->setEagerlyType(0);
    }
}
